home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <math.h>
-
- void main()
- {
- int i;
-
- printf("/*\n* cos table\n*\n*/\n");
- printf("#define sin256( rad ) ( cosTbl[((rad)+64)& 0xff] )\n" );
- printf("#define cos256( rad ) ( cosTbl[ (rad) & 0xff] )\n" );
-
- printf("\nstatic int cosTbl[] = {\n\t");
-
- for( i=0; i<256; i++ )
- { printf( "0x%08x, ", (int)(256*cos( (float)(_PI*i/128) )) );
-
- if( (i&3)== 3 )
- printf("\n\t");
- }
- printf("};\n");
-
- }
-